<?php
/**
check login table admin
*/
function checkLoginAdmin($username, $password) {
	$con = new ConnectDB();
	
	$tbl = "st_admin";
	$fn = array('st_useradmin');
	$condetion = array('st_useradmin' => $username, 'st_passadmin' => $password);
	$result = $con -> getvalue($tbl, $fn, $condetion);
	if(sizeof($result) != 0) {
		return true;
	}
	return false;
}
/**
check user exits
*/
function checkExist($username) {
	$con = new ConnectDB();
	
	$tbl = "st_admin";
	$fn = array('st_useradmin');
	$condetion = array('st_useradmin' => $username);
	$result = $con -> getvalue($tbl, $fn, $condetion);
	if(sizeof($result) != 0) {
		return true;
	}
	return false;
}


/**
update password admin
*/
function updateAdmin($username, $password) {
	$con = new ConnectDB();
	
	$tbl = "st_admin";
	$fn = array('st_passadmin' => $password);
	$condition = array('st_useradmin' => $username);
	return $con -> update($tbl, $fn, $condition);
}
?>